﻿using System;
using System.Collections.Generic;
//using System.ComponentModel;
//using System.Data;
//using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Netra
{
    partial class GalaxyMenuForm : TemplateMenuForm
    {
        #region Constructors
        public GalaxyMenuForm()
        {
            InitializeComponent();
        }

        public GalaxyMenuForm(Galaxy _galaxy)
        {
            galaxy = _galaxy;
            InitializeComponent();
        }

        public GalaxyMenuForm(Galaxy _galaxy, System.Drawing.Rectangle pozycja)
        {
            galaxy = _galaxy;
            InitializeComponent();//pozycja);
        }
        #endregion Constructors 

        #region Eventhandling
        private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
        {

        }

        private void splitContainer1_SplitterMoved_1(object sender, SplitterEventArgs e)
        {

        }

        private void button_planets_Click(object sender, EventArgs e)
        {
            if (this.Owner == null)//obsługa dobrego zamykania okienek, druga linia
            {
                //System.Console.WriteLine("dodałem ownera");
                GalaxyMenuPlanetsForm temp = new GalaxyMenuPlanetsForm(this.galaxy);
                this.AddOwnedForm(temp);
                temp.Show();
                this.Hide();
            }
            else
            {
                //System.Console.WriteLine("nie dodałem ownera, owner to:" + this.Owner.ToString());
                GalaxyMenuPlanetsForm temp = new GalaxyMenuPlanetsForm(this.galaxy);
                temp.Owner = this.Owner;
                temp.Show();
                this.Close();
            }
        }

        private void button_fleet_Click(object sender, EventArgs e)
        {
            if (this.Owner == null)//obsługa dobrego zamykania okienek, druga linia
            {
                //System.Console.WriteLine("dodałem ownera");
                GalaxyMenuFleetsForm temp = new GalaxyMenuFleetsForm(this.galaxy);
                this.AddOwnedForm(temp);
                temp.Show();
                this.Hide();
            }
            else
            {
                //System.Console.WriteLine("nie dodałem ownera, owner to:" + this.Owner.ToString());
                GalaxyMenuFleetsForm temp = new GalaxyMenuFleetsForm(this.galaxy);
                temp.Owner = this.Owner;
                temp.Show();
                this.Close();
            }
        }

        private void button_trade_routes_Click(object sender, EventArgs e)
        {
            if (this.Owner == null)//obsługa dobrego zamykania okienek, druga linia
            {
                //System.Console.WriteLine("dodałem ownera");
                TradeRoutesForm temp = new TradeRoutesForm(this.galaxy);
                this.AddOwnedForm(temp);
                temp.Show();
                this.Hide();
            }
            else
            {
                //System.Console.WriteLine("nie dodałem ownera, owner to:" + this.Owner.ToString());
                TradeRoutesForm temp = new TradeRoutesForm(this.galaxy);
                temp.Owner = this.Owner;
                temp.Show();
                this.Close();
            }
        }

        private void button_create_trade_route_Click(object sender, EventArgs e)
        {
            if (this.Owner == null)//obsługa dobrego zamykania okienek, druga linia
            {
                //System.Console.WriteLine("dodałem ownera");
                CreateTradeRouteForm tempCreateTradeRouteForm = new CreateTradeRouteForm(this.galaxy, new TradeRoute());
                this.AddOwnedForm(tempCreateTradeRouteForm);
                tempCreateTradeRouteForm.TopMost = true;
                tempCreateTradeRouteForm.Show();
                TradeRoutesForm tempTradeRoutesForm = new TradeRoutesForm(galaxy);
                this.AddOwnedForm(tempTradeRoutesForm);
                tempTradeRoutesForm.Show();
                this.Hide();
            }
            else
            {
                //System.Console.WriteLine("nie dodałem ownera, owner to:" + this.Owner.ToString());
                CreateTradeRouteForm tempCreateTradeRouteForm = new CreateTradeRouteForm(this.galaxy, new TradeRoute());
                tempCreateTradeRouteForm.Owner = this.Owner;
                tempCreateTradeRouteForm.TopMost = true;
                tempCreateTradeRouteForm.Show();
                //this.Close();
            }
            //CreateTradeRouteForm temp = new CreateTradeRouteForm(galaxy, new TradeRoute());
            //temp.Show();
            //this.AddOwnedForm(temp);
            //this.Close();
        }
        #endregion Eventhandling


    }

}

